DRAKHYSYS ALL EDITORS 110 - IN-GAME ACCOUNTS

INSTALL
1. Extract the complete All Editors folder and close BG2.
2. Run SETUP_IN_GAME_ACCOUNTS.bat.
   You can also open the UI Interface Editor and click SETUP IN-GAME ACCOUNT LOGIN.
3. Choose the BG2 installation folder (Baldur.exe / BaldurII.exe), the BG2 profile
   folder containing your current Baldur.lua, and the account storage folder.
4. Click INSTALL IN-GAME ACCOUNTS, then launch BG2 normally.

The installer uses the current override/UI.MENU when it exists and preserves its
campaign/background layout. If it is absent, it uses IN_GAME_ACCOUNTS_READY/UI.MENU,
built from the UI.MENU supplied for this update. Keep your existing background
resources in override. Copying UI.MENU alone does not install the account helper.

USING IT
- CREATE ACCOUNT / LOG IN appears inside BG2, including the multiplayer lobby.
- New account passwords require 8-128 characters. Existing launcher accounts with
  their original password hashes remain readable.
- CONTINUE returns to your existing campaign and multiplayer screens.
- Each player logs into an account in their own BG2 instance. One active BG2
  instance may use a given Windows profile's character folder at a time.
- Create a character, or choose LOAD ACCOUNT CHARACTER during character creation.
- Only characters currently in the logged-in account folder are offered for Load.
- In the Record screen, SAVE ACCOUNT CHARACTER saves your account's character.
  Further saves update the SAME file. There is no arbitrary filename / Save As.
  Confirm the engine's overwrite prompt if it appears.
- Log out / change account from the main menu, after leaving the party/game.

NO CHARACTER BACKUPS / NO AUTOMATIC RESTORATION
The account integration never copies, restores, synchronizes, or resurrects CHRs.
Startup, login, and opening the editor write no character files. Only your manual
SAVE ACCOUNT CHARACTER action asks BG2 to write a character. Deleted files remain
deleted unless you explicitly save that currently loaded character again.
The reference CHR in the editors is never installed into an account automatically.
This update installs no Windows Startup entry or scheduled task.

One account's storage, for example:
  C:\DRAKHYSYS_BG2_ONLINE\Drakhysys\
The BG2 characters folder points directly to that active folder. There is no
second character cache and no backup directory used for restoring characters.
Account metadata and session metadata contain no character data.

IF YOUR ORIGINAL CHARACTERS FOLDER ALREADY CONTAINS FILES
Existing characters are not assigned, moved or deleted automatically.
Create your account inside BG2 first. If activation is blocked, the screen shows
the original characters path and your new account folder. Close BG2 and manually
MOVE the characters you want to keep into that account folder (with their .BIO
files if present). The original characters folder must be empty. Restart BG2 and
LOG IN with the account you created. Unwanted characters can simply stay deleted.
Do not move account.json; that file belongs to its account folder.

UI INTERFACE EDITOR
- Added SETUP IN-GAME ACCOUNT LOGIN.
- Added the Account: Create / Log in button action.
- Visual UI exports include the login menu, account-only Load, and controlled Save.
- Re-exporting preserves the installed helper configuration and avoids duplicate
  account menus/buttons.
- The earlier malformed completeSave / completeOverwrite Lua declarations are fixed.
- The old external account launcher remains a legacy tool. Use the setup above
  for the in-game flow; it does not require the external login window.

WINDOWS REQUIREMENTS / TEST STATUS
Python 3.10+ and the editor's existing PySide6/Pillow requirements are used for
setup. The installed account handler itself uses Python's standard library.
The in-game interface uses BG2EE UI functions and Windows custom-URI handling.
The helper is registered for the current Windows user and is invoked on demand;
it does not add a startup service. Passwords are salted PBKDF2 hashes. Requests
are authenticated and encrypted so plaintext passwords are not in URI command
lines, UI.MENU, or Baldur.lua.

This is LOCAL account isolation in this BG2 installation. It is not a remote
account server or protection against somebody who can modify files under the
same Windows account. Each independent multiplayer PC needs its own installation.

16 account/Lua tests and 11 prior UI regression checks passed. The embedded Lua
and patched action syntax were checked. GODKRONO(1).chr and the supplied BIF/KEY
resource tables were inspected. BG2 and the Windows Shell are not available in
the test environment: the native menu rendering, custom-URI dispatch, junction
creation on your PC, and real engine Save/Load still need an in-game test.

If the account screen says 'No reply', close BG2 and rerun setup. The selected
Python installation must contain pythonw.exe. Check the game folder's
drakhysys_accounts/last_error.txt if it exists. Do not keep clicking Login if
Windows asks which app should handle drakhysys-bg2; finish setup first.

If old characters reappear even with this update, an older program or Windows
startup task may still be restoring them. This package cannot remove an unknown
startup task on your PC. It never reads an old character-backup folder.

Developer reference for the native UI hooks:
https://forums.beamdog.com/discussion/67905/new-ui-modding-features
https://eeex-docs.readthedocs.io/en/latest/EE%20Game%20Lua%20Functions/Infinity/
https://learn.microsoft.com/en-us/windows/win32/shell/launch


V111 ACCOUNT CONNECTION / PASSWORD PASTE FIX
- Password and Confirm now each have a PASTE button. The password may remain hidden while pasting.
- V116 uses an integer-only Baldur.lua mailbox for live in-game account requests; no browser, custom URL protocol, or external account launcher is used.
- Setup performs an end-to-end Windows protocol test and will not silently report success if the helper cannot answer.
- REPAIR_ACCOUNT_CONNECTION.bat reruns the setup/connection test.
- No character backup, copy, restore, sync, or resurrection behavior was added. Deleted CHR files remain deleted.

V112 direct local behavior
1. CREATE ACCOUNT validates the entered fields and creates the account folder + account.json only. It does not log in.
2. LOG IN validates the password and switches the BG2 profile characters junction directly to that account folder.
3. LOAD ACCOUNT CHARACTER enumerates only valid CHR files from the logged-in folder.
4. SAVE ACCOUNT CHARACTER exports through the same junction, so BG2 writes directly into the logged-in account folder.
5. LOG OUT points the junction to the empty locked folder.
6. No backup/copy/restore/sync path exists in this runtime.


V116 numeric mailbox
- Account creation and login stay inside BG2.
- The local helper runs silently on the BG2 PC.
- Requests are encrypted, packed into integer INI values, and committed with a numeric Ready marker.
- Moonlight clients install nothing.
- No character backup, restoration, synchronization, or respawn.


V123 SAVE/LOAD ACCOUNT FOLDERS
- SAVE temporarily exposes characters_<account> as characters, uses BG2 native export, then renames it back immediately.
- LOAD temporarily exposes characters_<account> as characters, uses BG2 native import, then renames it back on Done/Cancel.
- No character copy, backup, restore, merge or synchronization.
